<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>

<script type="text/javascript">
function deleteInfo() {
	var flag=false;
	check=document.getElementsByName("selectFlag");
	var ids=new Array();
	var j=0;
	for(var i=0;i<check.length;i++){
		if(check[i].checked==true){
			flag=true;
			ids[j]=check[i].value;
			j++;
		}
	}
	if(!flag){alert("请选择至少选择一个你要删除的信息");}
	else if(window.confirm("确定删除")){
		with(document.getElementById("userinfoform")){
			method="post";
			action="bbsUserInfo_delete.do?ids="+ids;
			submit();
		}
	}	
}

function checkAll() {
	var selectFlags = document.getElementsByName("selectFlag");
	for (var i=0; i<selectFlags.length; i++) {
		selectFlags[i].checked = document.getElementById("checkbox_userinfo").checked;
		//采用getElementsByName代替getElementById
		//selectFlags[i].checked = document.getElementsByName("ifAll")[0].checked;
	}
}

</script>
</head>

<body>
<form action="" id="userinfoform">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="19" valign="bottom"><div align="center"><img src="images/tb.gif" width="14" height="14" /></div></td>
                <td width="94%" valign="bottom"><span class="STYLE1"> 管理人员基本信息列表</span></td>
              </tr>
            </table></td>
            <td><div align="right"><span class="STYLE1">
              <input type="checkbox" name="checkbox_userinfo" id="checkbox_userinfo" onclick="checkAll()" />
              全选      &nbsp;&nbsp; <img src="images/del.gif" width="10" height="10" /><a href="#" onclick="deleteInfo()" id="userinfodelete" > 删除</a>    &nbsp;&nbsp; &nbsp;</span><span class="STYLE1"> &nbsp;</span></div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
      <tr>
        <td width="4%" height="20" bgcolor="d3eaef" class="STYLE10"><div align="center">
        </div></td>
        <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">用户名</span></div></td>
        <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">用户邮箱</span></div></td>
        <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">用户性别</span></div></td>
        <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">用户级别</span></div></td>
        <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">用户状态</span></div></td>
        <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">用户积分</span></div></td>
        <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">基本操作</span></div></td>
      </tr>
    <c:forEach items="${bbsUserInfoList}" var="userinfor" >
      <tr>
        <td height="20" bgcolor="#FFFFFF"><div align="center">
          <input type="checkbox" name="selectFlag" id="selectFlag"  value="${userinfor.userid}"/>
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE6"><div align="center"><span class="STYLE19">${userinfor.username}</span></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">${userinfor.email}</div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">
						<c:if test="${userinfor.userSex==0}">男</c:if>
						<c:if test="${userinfor.userSex==1}">女</c:if>
		</div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">
        	<c:if test="${userinfor.userLevel==1}">初级会员</c:if>
			<c:if test="${userinfor.userLevel==2}">中级会员</c:if>
			<c:if test="${userinfor.userLevel==3}">高级会员</c:if>
			<c:if test="${userinfor.userLevel==4}">版主</c:if>
			<c:if test="${userinfor.userLevel==5}">系统管理员</c:if>
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">
        	<c:if test="${userinfor.userState==0}">锁定</c:if>
			<c:if test="${userinfor.userState==1}">未锁定</c:if>
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">${userinfor.userIntergral}</div></td>
        <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE21"><a href="bbsUserInfo_edit.do?id=${userinfor.userid}&page=${page}" >编辑</a> |<a href="bbsUserInfo_show.do?id=${userinfor.userid}&page=${page}"> 查看</a></div></td>
      </tr>
    </c:forEach>  
    </table></td>
  </tr>
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="33%"><div align="left"><span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong> ${maxcount }</strong> 条记录，当前第<strong>${page }</strong> 页，共 <strong>${maxpage }</strong> 页</span></div></td>
        <td width="67%"><table width="312" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td width="49"><div align="center"><a href="bbsUserInfo_list.do?page=1">首页</a></div></td>
            <td width="49"><div align="center"><a href="bbsUserInfo_prePage.do?page=${page}">上一页</a></div></td>
            <td width="49"><div align="center"><a href="bbsUserInfo_nextPage.do?page=${page}">下一页</a></div></td>
            <td width="49"><div align="center"><a href="bbsUserInfo_list.do?page=${maxpage}">末页</a></div></td>
            <td width="37" class="STYLE22"><div align="center"><a href="#">转到第</a></div></td>
            <td width="22"><div align="center">
              <input type="text" name="page" id="bbsuserinfo_page"  style="width:30px; height:20px; font-size:12px; border:solid 1px #7aaebd;"/>
            </div></td>
            <td width="22" class="STYLE22"><div align="center">页</div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
</body>
</html>
